<template>
  <div class="meeting-item-head">
    <span class="meeting-item-head-status">{{item.meetingStatus === 1 ? getMeeingDate(item.startTime) : (item.meetingStatus === 0 && userType !== 10 ? "待发起" : meetingStatus[item.meetingStatus])}}</span>
    <span class="meeting-item-head-time">{{fromatDateTime(item.startTime)}}</span>
  </div>
  <div class="meeting-item-body">
    <div class="meeting-item-body-name">
      <span class="iconfont icon-biaoqian"></span>
      {{ item.name }}
    </div>
    <div class="meeting-item-body-place baseSt">
      <span class="iconfont icon-didian"></span>
      {{ item.roomNumber ? `${item.roomNumber}` : "线上会议" }}
    </div>
    <div class="meeting-item-body-describe baseSt">
      <span class="iconfont icon-miaoshu2"></span>
      {{ item.describe }}
    </div>
  </div>
</template>

<script>
import { useStore } from 'vuex'
import { computed } from 'vue';
import { fromatDateTime, getMeeingDate } from "@/utils/formatDate.js"
import { meetingStatus } from '@/enum.js'
export default {
  name: "MeetingItem",
  props: ["item"],
  setup() {
    const store = useStore();

    const userType = computed(() => store.getters.getUserType);

    return {
      userType,
      fromatDateTime,
      getMeeingDate,
      meetingStatus
    }
  }
}
</script>

<style lang="scss" scoped>
.meeting-item-head {
  width: 10rem;
  height: 100%;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  &-status {
    font-size: var(--second-text-size);
    color: var(--second-text-color);
    margin-bottom: 0.8rem;
    font-weight: var(--second-text-weight);
  }
  &-time {
    font-size: 1.6rem;
    font-weight: var(--primary-text-weight);
  }
}
.meeting-item-body {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  padding-left: 3rem;
  .baseSt {
    font-size: var(--second-text-size);
    color: var(--second-text-color);
    font-weight: var(--second-text-weight);
    width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .iconfont {
    margin-right: 0.5rem;
    font-size: 1.5rem;
    color: #aaa;
  }
  &-name {
    font-weight: var(--primary-text-weight);
    font-size: 1.6rem; 
    width: 22rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  &-place {
  }
  &-describe {
    // overflow: hidden;
  }
}
</style>